package cn.walnut.web.async;

import org.springframework.stereotype.Component;

/**
 * @program: walnut-security
 * @Date: 2018/12/21 22:24
 * @Author: Walnut1992
 * @Description:
 */
@Component
public class MOckQueue {
    private String placeOrder;
    private String competeOrder;

    @Override
    public String toString() {
        return "MOckQueue{" +
                "placeOrder='" + placeOrder + '\'' +
                ", competeOrder='" + competeOrder + '\'' +
                '}';
    }

    public String getPlaceOrder() {
        return placeOrder;
    }

    public void setPlaceOrder(String placeOrder) throws Exception{
        System.out.println("接到下单请求" + placeOrder);
        Thread.sleep(1000);
        this.competeOrder = placeOrder;
        System.out.println("下单完成" + competeOrder);
    }

    public String getCompeteOrder() {
        return competeOrder;
    }

    public void setCompeteOrder(String competeOrder) {
        this.competeOrder = competeOrder;
    }
}
